'We assume that GdPicture has been correctly installed and unlocked.
Using oGdPicturePDF AsNew GdPicturePDF()
Dim status As GdPictureStatus = oGdPicturePDF.LoadFromFile("test.pdf", True) 'The file is loaded into memory.
If status = GdPictureStatus.OK ThenIf oGdPicturePDF.ClonePage(1) = GdPictureStatus.OK Then'Processing...
status = oGdPicturePDF.SaveToFile("test.pdf") 'The file is overwritten.
If status = GdPictureStatus.OK Then
MessageBox.Show("The PDF file has been overwritten and saved sucessfully.", "Saving PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Information)
Else
MessageBox.Show("The file can't be saved. Status: " + status.ToString(), "Saving PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error)
EndIf
oGdPicturePDF.CloseDocument()
EndIfElse
MessageBox.Show("The file can't be opened. Status: " + status.ToString(), "Saving PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error)
EndIfEndUsing
Copy Code
//We assume that GdPicture has been correctly installed and unlocked.
using (GdPicturePDF oGdPicturePDF = new GdPicturePDF())
{
GdPictureStatus status = oGdPicturePDF.LoadFromFile("test.pdf", true); //The file is loaded into memory.
if (status == GdPictureStatus.OK)
{
if (oGdPicturePDF.ClonePage(1) == GdPictureStatus.OK) //Processing...
{
status = oGdPicturePDF.SaveToFile("test.pdf"); //The file is overwritten.
if (status == GdPictureStatus.OK)
{
MessageBox.Show("The PDF file has been overwritten and saved sucessfully.", "Saving PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
else
{
MessageBox.Show("The file can't be saved. Status: " + status.ToString(), "Saving PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
oGdPicturePDF.CloseDocument();
}
}
else
{
MessageBox.Show("The file can't be opened. Status: " + status.ToString(), "Saving PDF Example", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}